<?php

include('../../include/functions.inc.php');
include('../../include/maintenance.inc.php');

if (!isset($_SESSION['mCourse'])) {
    $maintenance = new Maintenance();

    $maintenance->windowTitle = 'Catalogo Cursos';
    $maintenance->newUrlPage = 'new.php';
    $maintenance->editUrlPage = 'edit.php';
    $maintenance->saveNewUrlPage = 'data.php?operation=s';
    $maintenance->updateUrlPage = 'data.php?operation=u';
    $maintenance->deleteUrlPage = 'data.php?operation=d';
    $maintenance->listJsonUrl = 'list.php';
    $maintenance->path = '../../';
    $maintenance->staticsUrl = 'index.php?statics=true';
    $maintenance->editUrlParams = array("CODE" => "CODIGO");
    $maintenance->deleteUrlParams = array("CODE" => "CODIGO");
    $maintenance->table = "cllg_courses_catalog";
    $maintenance->validations = array("required,NAME,Nombre es Requerido", "required,CODE,Codigo de Curso es Requerido");

    $_SESSION['mCourse'] = serialize($maintenance);
} else {
    $maintenance = unserialize($_SESSION['mCourse']);
}

if (!isEmpty(getParam('statics'))) {
    $maintenance->statics(count($db->query_select('cllg_catalog_courses')));
} else {
    $maintenance->build();
}
?>